﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MVVMLightDemo.Implements;
using MVVMLightDemo.interfaces;
using MVVMLightDemo.Models;
using System.Collections.Generic;

namespace DemoTest
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestExportExcel()
        {
            NinjectContainer container = new NinjectContainer();
            container.AddSingleton<IExcelHelper, ExcelService>();
            container.GetServices<IExcelHelper>().CreateExcel(@"D:\test.xlsx");
            List<DownTaskModel> list = new List<DownTaskModel>
            {
                new DownTaskModel{DownloadTime = DateTime.Now,DownSpeed = 700,FileAttribute = FileType.Document,FileDownloaded = 200,FileName = "111",FileSize = 1200,FinishRate = 0.8 },
                new DownTaskModel{DownloadTime = DateTime.Now,DownSpeed = 400,FileAttribute = FileType.Document,FileDownloaded = 200,FileName = "2223",FileSize = 8900,FinishRate = 0.8 }
            };
            bool succeed = container.GetServices<IExcelHelper>().Export<DownTaskModel>(list);
            Assert.AreEqual(succeed,true);
        }

        [TestMethod]
        public void TestEnvirPath()
        {
            foreach (Environment.SpecialFolder s in
                    Enum.GetValues(typeof(Environment.SpecialFolder)))
            {
                Console.WriteLine("{0} folder : {1}",
                    s, Environment.GetFolderPath(s));
            }
        }
    }
}
